package com.web2.utils;

import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.Enumeration;
import java.util.Properties;
import java.util.ResourceBundle;

public class ConfigUtils {
    public static Properties properties = new Properties();

    static {
        refreshProperty();
    }

    private static void refreshProperty() {
        InputStream inputStream = ConfigUtils.class.getResourceAsStream("/config.properties");
        try {
            properties.load(inputStream);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static String getProperty(String key) {
        return properties.getProperty(key);
    }

    public static Integer getInteger(String key) {
        return Integer.valueOf(properties.getProperty(key));
    }

    public static Boolean getBoolean(String key) {
        return Boolean.valueOf(properties.getProperty(key));
    }

    public static void main(String[] args) {
        System.out.println(ConfigUtils.getProperty("sso.url.signIn"));
    }
}

